package writtenTraining.day15;

import java.util.*;

/**
 * day15:(1):数学开根号：平方数
 */
public class Main {
    public static void main(String[] args) {
        // 数学 + 开根号
        Scanner in = new Scanner(System.in);
        long x = in.nextLong();
        long left  =   (int)Math.sqrt(x);
        long right = left + 1;
        
        if((x - left * left) > (right * right - x )) {
            System.out.println(right * right);            
        } else {
            System.out.println(left * left);            
        }
    }
}



 class Main1 {
    public static void main(String[] args) {
        // 贪心
        /**
         * 时间复杂度上过不去
         */
        Scanner in = new Scanner(System.in);
        long target = in.nextLong();
        long num = 0, flg = 0x3f3f3f3f;
        while(true) {
            long n  = num * num;
            if((long)Math.abs(target - n) < flg) {
                flg = Math.abs(target - n);
                num++;
            } else {
                num--;
                break;
            }
        }

        // 输出结果
        System.out.println(num * num);
    }
}


/**
 * day15:(2)枚举：分组
 */



class Main2 {
    public static void main(String[] args) {
        // 枚举结果
        Scanner in = new Scanner(System.in);
        int n  = in.nextInt(), m = in.nextInt();

        Map<Integer,Integer> map = new HashMap<>();
        int maxNum = 0;
        for(int i = 0; i < n ; i++) {
            int num = in.nextInt();
//             统计每种声部的个数
            map.put(num,map.getOrDefault(num,0) + 1);
            maxNum = Math.max(map.get(num), maxNum);
        }

//         需要的组数
        int sz = map.size();
        if(sz > m) {
            System.out.println(-1);
        } else {
            //             定义当前的组数
            int groupCount = 0, i = 1;
            int ret = 0;
            while(maxNum >= i ) {
                groupCount = 0;
                for(int count : map.values()) {
                    groupCount += ((count / i) +
                            ((count % i) > 0 ? 1 : 0));
                }
                if(groupCount <= m) {
                    ret = i;
                    break;
                }
//                 调整参数
                i++;
            }

            // 输出结果
            System.out.println(ret);
        }


    }
}

/**
 * day15:(2)二分 + 正难则反结果：分组
 */
 class Main3 {
    public static void main(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        // 二分 + 正难则反结果
        Scanner in = new Scanner(System.in);
        int n  = in.nextInt(), m = in.nextInt();

        Map<Integer,Integer> map = new HashMap<>();
        int maxNum = 0;
        for(int i = 0; i < n ; i++) {
            int num = in.nextInt();
//             统计每种声部的个数
            map.put(num,map.getOrDefault(num,0) + 1);
            maxNum = Math.max(map.get(num), maxNum);
        }

//         需要的组数
        int sz = map.size();
        if(sz > m) {
            System.out.println(-1);
        } else {
            //             定义当前的组数
            int left = 1, right = maxNum;
            while(left < right) {
                int mid = left + (right - left) / 2;
                int group = 0;
                for(int count : map.values()) {
                    group += ( (count / mid) +
                            (count % mid > 0 ? 1 : 0));
                }

                if(group > m) {
//                     不满足就跳跃到右区域中
                    left = mid + 1;
                } else {
//                     满足就缩小右区域的值，
//                         直到确定右区域的左边界
                    right = mid;
                }
            }

            System.out.println(left);

        }


    }
}